
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
	
namespace Swaf.BizObj
{
	/// <summary> Provides for basic storage and access to a bundle of business objects and 
	/// lists of business objects.
	/// 
	/// Each implementation of this interface can manage is storage of business
	/// objects in its own way and thus have its own level of complexity in terms
	/// of how manu business objects it can store and what kind of structure
	/// those objects can be exposed as.
	/// </summary>
	/// <author>  root
	/// 
	/// </author>
	public interface IBizObjSource
	{
		/// <summary>Returns a list of business objects based on criteria specified.
		/// Given the criteria specified, a collection of business objects is returned
		/// that are of the type specified in objType.</summary>
		/// <param name="objType">A defined business object type</param>
		/// <param name="info">Implementation specfic search criteria that defines which
		/// business objects should be in the list.</param>
		/// <returns>a IBizObjList if successfully able to access the list.</returns>
		IBizObjList getList(string objType, string info);

		/// <summary>
		/// Returns a cursor to a list of business objects based on the criteria specified.
		/// </summary>
		/// <param name="objType"></param>
		/// <param name="info"></param>
		/// <returns></returns>
		IBizObjCursor getCursor(string objType, string info);

		/// <summary>Returns a business object based on the criteria specified.
		/// Given the criteria specified, a single business object is returned that will
		/// be of the type objType.</summary>
		/// <param name="objType">A defined business object type</param>
		/// <param name="info">Implementation specific search criteria that defines which
		/// business object should be returned.</param>
		IBizObj getObject(string objType, string info);

		/// <summary>
		/// Returns a business object that matches against the fieldList and searchValue provided.
		/// This is meant to be a implementation nutral way of searching for business objects within
		/// the context of this data source.
		/// </summary>
		/// <param name="objType"></param>
		/// <param name="fieldList"></param>
		/// <param name="searchValue"></param>
		/// <returns></returns>
		IBizObj getObject(string objType, string fieldList, object searchValue);
		IBizObj getObject(string objType, string fieldList, object searchValue,bool findNearestMatch);
		/// <summary>
		/// Removes all references to contained IBizObjLists.
		/// </summary>
		void Clear();
		
		/// <summary>
		/// Removes a reference to a specific named IBizObjList.
		/// </summary>
		/// <param name="name"></param>
		void RemoveList(string name);
		/// <summary>
		/// Allows BizObjLists to be manually added to the source.
		/// </summary>
		/// <param name="newList"></param>
		void AddList(IBizObjList newList);
	}
}